#pragma once
#ifdef XOLIBCPP_EXPORTS
#define XOLIBCPP_API __declspec(dllexport)
#else
#define XOLIBCPP_API __declspec(dllimport)
#endif
/* Copyright(c) 1998-2012, Arnaud Colin
 * All rights reserved.
 *
 * Licence GNU GPL version 3
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   -> Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *
 *   -> Redistributions in binary form must reproduce the above copyright
 *      notice, this list of conditions and the following disclaimer in the
 *      documentation and/or other materials provided with the distribution.
 */

class XOLIBCPP_API CRegistryKey
{
	public:
	HKEY hKey;
	bool bWrite;

	CRegistryKey(void);

	void SetValue(LPWSTR key, BYTE Data[] , DWORD len );
	//void SetValue(LPWSTR key, byte Data[] );
	void SetValue(LPWSTR key, DWORD Data );
	void SetValue(LPWSTR key, LPWSTR Data );
	void GetValue(LPWSTR key);

};

class XOLIBCPP_API CRegistry
{
	private:
		HKEY _hKey;
		CRegistry(HKEY hKey);

	public:
	 static CRegistry* CurrentUser(void);
	static CRegistry* LocalMachine(void);

	CRegistryKey* CreateSubKey(LPWSTR key);
	CRegistryKey* OpenSubKey(LPWSTR key, bool bWrite = false);
	CRegistryKey* GetSubKey(LPWSTR key);

	void CheckSubKey(LPWSTR key);

};

